import {deleteAffiliate, getAffiliate} from '@/base/api/AffiliateApi';
import {Affiliate} from '@/base/model/Affiliate';

export class AffliateDetailBloc {
  form = new Affiliate();
  loading = false;

  load(id: number) {
    return getAffiliate(id)
      .then((res) => {
        this.form = res.data;
      });
  }
  removeItem(id: number) {
    this.loading = true;
    return deleteAffiliate(id)
      .finally(() => {
        this.loading = false;
      });
  }
}
